package com.wnxy.portal.controller;

import com.wnxy.portal.common.result.Result;
import com.wnxy.portal.model.vo.BooktypeVo;
import com.wnxy.portal.service.IBooktypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Jet
 * @since 2023-12-11
 */
@RestController
@RequestMapping("/booktype")
@Api(tags = "图书分类")
@Slf4j
public class BooktypeController {

    @Autowired
    private IBooktypeService booktypeService;

    /**
     * 查询图书分类
     */
    @GetMapping
    @ApiOperation("查询所有图书分类")
    public Result findBookTypes(){
        List<BooktypeVo> list = booktypeService.findBookTypes();
        return Result.ok(list);
    }
}
